package com.zyong.design.pattern.interpret.case1;

/**
 * 非终结表达式-具体表达式-减法表达式
 * @program: zyong-design-pattern
 * @ClassName: SubExpression
 * @author: zyong
 * @create: 2024-06-01 20:33
 */
public class SubExpression extends AbstractNonTerminalExpression {
    public SubExpression(IExpression leftExpression, IExpression rightExpression) {
        super(leftExpression, rightExpression);
    }

    @Override
    public int interpret() {
        return this.leftExpression.interpret() - this.rightExpression.interpret();
    }
}
